rule.uc: always format ICMP type/code list as set
Ensure that the concatenated type . code list values are always formatted
as anonymous set, even if the list just contains one item. Fixes the
following nftables error when parsing such a rule:
Error: Use concatenations with sets and maps, not singleton values
Signed-off-by: Jo-Philipp Wich <[email protected]>
treewide: convert deprecated syntax
- `local` has been deprecated in favor to `let`
- `delete(obj, "prop")` has been depracted in favor to `delete obj.prop`
Signed-off-by: Jo-Philipp Wich <[email protected]>
tests: adapt to latest ucode
- Environment must be set before preloading and executing modules
- Caching of fs module must be inhibited
- Mocklib class object should be returned
Signed-off-by: Jo-Philipp Wich <[email protected]>
tests: expand testing
- Rewrite test framework
- Add initial rule test coverage
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: fix family test functions
Rewrite the family test functions as arrow functions since ucode HEAD does
implicitly return the last function value expression as result anymore for
ordinary functions.
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: fix parsing boolean "0" values
Signed-off-by: Jo-Philipp Wich <[email protected]>
rule.uc: fix redundant whitespace in rules without target
Signed-off-by: Jo-Philipp Wich <[email protected]>
ruleset.uc: reduce empty lines in output
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: gracefully handle missing defaults section
Signed-off-by: Jo-Philipp Wich <[email protected]>
treewide: remove ucode module preloading
Instead of preloading ucode modules via the cmdline, require the modules
as needed. This simplifies test case constructions since mock modules
can be injected by modifying the search path.
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: remove upvalue caching
Now that ucode HEAD inherits the global scope in include() by default, we
do not need to cache our used functions anymore.
Signed-off-by: Jo-Philipp Wich <[email protected]>